﻿using System;
using System.Collections.Generic;
using System.Text;
using HAVNet.Core.String;


namespace HAVNet.Intros.AST
{
    public class ASTEnumMemberDecls : List<ASTEnumMemberDecl>
    {
        public bool hasFinalComma { get; set; }

        public override string ToString ()
        {
            return Strings.joinobjs ("," + Environment.NewLine, this);
        }
    }

    public class ASTEnumMemberDecl : ASTMemberDeclEnum
    {
        public string               ident       { get; set; }
        public ASTExpr        expression  { get; set; }

        public override string ToString()
        {
            string sAttrs   = (null == _attrGroups ? "" : _attrGroups.ToString() + Environment.NewLine);
            string sEqExpr  = (null == expression  ? "" : " = " + expression.ToString());
            return  sAttrs + ident + sEqExpr;
        }
    }
}
